<?php

/**
 * DtSchedule filter form base class.
 *
 * @package    DUYTAN
 * @subpackage filter
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 29570 2010-05-21 14:49:47Z Kris.Wallsmith $
 */
abstract class BaseDtScheduleFormFilter extends BaseFormFilterDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'cost'         => new sfWidgetFormFilterInput(),
      'cost_weekend' => new sfWidgetFormFilterInput(),
      'promotion'    => new sfWidgetFormFilterInput(),
    ));

    $this->setValidators(array(
      'cost'         => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'cost_weekend' => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'promotion'    => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
    ));

    $this->widgetSchema->setNameFormat('dt_schedule_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'DtSchedule';
  }

  public function getFields()
  {
    return array(
      'ground_id'    => 'Number',
      'schedule'     => 'Text',
      'cost'         => 'Number',
      'cost_weekend' => 'Number',
      'promotion'    => 'Number',
    );
  }
}
